<?php
/**
 * Pdomysql.php
 * 
 * @category    Madoqua
 * @package     Module
 * @subpackage  Install
 */

/** base class */
require_once 'Madoqua/Form.php';

/** connection validator */
require_once 'Madoqua/Validate/Database.php';

/**
 * Install_Database_Pdomysql
 * 
 * @category    Madoqua
 * @package     Module
 * @subpackage  Install
 */
class Install_Database_Mysql extends Madoqua_Form
{
    /**
     * constructor
     *
     * @param array $options
     */
    public function __construct($options) {
        parent::__construct();
        
        $this->addElement('text', 'host', array(
            'label' => 'Hostname',
            'required' => true,
            'autocomplete' => 'off'
        ));
        //hostname
        
        $this->addElement('text', 'username', array(
            'label' => 'Username',
            'required' => true,
            'autocomplete' => 'off'
        )); 
        //username
        
        $this->addElement('password', 'password', array(
            'label' => 'Password',
            'required' => false,
            'autocomplete' => 'off'
        ));
        //password
        
        $this->addElement('text', 'dbname', array(
            'label' => 'Database name',
            'required' => true,
            'validators' => array(
                new Madoqua_Validate_Database('pdo_mysql')
            ),
            'autocomplete' => 'off'
        ));
        //database name
        
        $this->addElement('text', 'prefix', array(
            'label' => 'Table prefix',
            'autocomplete' => 'off'
        ));
        
        $this->addElement('submit', 's', array(
            'label' => 'Continue'
        ));
        
        $this->setDefaults(array(
            'host' => 'localhost',
            'prefix' => 'madoqua_'
        ));
        //defaults
    }
    
<<<<<<< HEAD:madoqua_private/application/modules/install/forms/Database/Mysql.php
}
=======
}
>>>>>>> local:madoqua_private/application/modules/install/forms/Database/Mysql.php
